#!/usr/bin/env python
# _*_ coding: utf-8 _*_
# @Time : 2020/7/7 4:09
# @Author : LZQ
# @Version：V 0.1
# @File : status_code.py
# @desc :
class RET:
    OK = {'code': 200}
    SUCCESS = {'code': 200, 'msg': '请求成功'}
    FAIL = {'code': 400, 'msg': '请求失败'}
    DATABASE_ERROR = {'code': 900, 'msg': '数据库请求失败'}
    PARAMS_ERROR = {'code': 901, 'msg': '参数错误！'}
    PARAMS_NOTALL = {'code': 902, 'msg': '参数不全！'}
    CAPTCHA_ERROR = {'code': 903, 'msg': '图片验证码输入错误！'}
    CAPTCHA_OUT_OF_DATE = {'code': 904, 'msg': '图片验证码过期'}
    PARAMS_AREA_EXISTS = {"code": 905, "msg": "城区不存在"}
    PARAMS_DATA_ERROR = {"code": 906, "msg": "日期参数错误！"}
    # 用户模块
    USER_LOGIN_OUT = {"code": 10010, "msg": "已退出登录"}
    USER_ENABLE = {"code": 10011, "msg": "用户已启用"}
    USER_DISABLE = {"code": 10012, "msg": "用户已禁用"}
    USER_ALERT_STATE_SUCCESS = {"code": 10013, "msg": "用户状态修改成功"}
    USER_ALERT_STATE_FAIL = {"code": 10013, "msg": "用户状态修改失败"}
    USER_EDIT_SUCCESS = {"code": 10014, "msg": "用户修改成功"}
    USER_EDIT_FAIL = {"code": 10015, "msg": "用户修改失败"}
    USER_DELETE_SUCCESS = {"code": 10016, "msg": "删除用户成功"}
    USER_DELETE_FAIL = {"code": 10017, "msg": "删除用户失败"}
    USER_NOT_EXIST = {"code": 10018, "msg": "该用户不存在"}
    USER_REGISTER_USER_IS_EXITS = {'code':10019,'msg':'该用户名已存在'}
    USER_REGISTER_USER_IS_NOT_EXITS = {"code":10020,"msg":"该用户名可以使用"}
    USER_PARAMS_LACK = {'code': 10021, 'msg': '注册用户的参数不全'}
    USER_REGISTER_SUCCESS = {'code': 10022, 'msg': '用户注册成功'}
    USER_REGISTER_FAIL =  {'code': 10022, 'msg': '用户注册失败'}
    USER_NAME_IS_NOTEXIST = {"code": 10030, "msg": "用户不存在"}
    USER_UPDATE_ROLE_SUCCESS = {"code": 10031, "msg": "用户角色更新成功"}
    USER_UPDATE_ROLE_FAIL = {"code": 10032, "msg": "用户角色更新失败"}

    #角色模块
    ROLE_GET_LIST_SUCCESS = {'code': 10100, 'msg': '获取角色列表成功！'}
    ROLE_GET_LIST_FAIL = {'code': 10101, 'msg': '获取角色列表失败'}
    USER_LOGIN_IS_NOT_EXIST = {'code': 10102, 'msg': '用户不存在'}
    USER_LOGIN_PASSWORD_IS_ERROR = {'code': 10103, 'msg': '用户密码错误'}
    USER_GET_EXSIST_ERROR = {"code": 10104, "msg": "获取用户信息错误！"}
    ROLE_DELETE_SUCCESS = {'code':10105,"msg": "删除角色成功！"}
    ROLE_DELETE_FAIL = {'code': 10106,"msg": "删除角色失败！"}
    ROLE_DELETE_PERMISSION_SUCCESS = {'code': 10107, "msg": "删除角色权限成功！"}
    ROLE_DELETE_PERMISSION_FAIL = {'code': 10108,"msg": "删除角色权限失败！"}
    ROLE_UPDATE_PERMISSION_SUCCESS = {'code': 10109, "msg": "修改角色权限成功！"}
    ROLE_UPDATE_PERMISSION_FAIL = {'code': 10110, "msg": "修改角色权限失败！"}
    ROLE_ADD_PERMISSION_SUCCESS = {'code': 10111, "msg": "添加角色权限成功！"}
    ROLE_ADD_PERMISSION_FAIL = {'code': 10112, "msg": "添加角色权限失败！"}
    ROLE_ADD_SUCCESS = {'code': 10113, "msg": "添加角色成功！"}
    ROLE_ADD_FAIL = {'code': 10114, "msg": "添加角色失败！"}
    ROLE_NAME_DONET_EXIST = {'code': 10115, "msg": "角色名称不存在！"}
    ROLE_NAME_EXIST = {'code': 10116, "msg": "角色名称存在！"}
    ROLE_UPDATE_SUCCESS = {'code': 10117, "msg": "修改角色成功！"}
    ROLE_UPDATE_FAIL = {'code': 10118, "msg": "修改角色失败！"}

    #权限相关
    PERMISSION_GET_LIST_SUCCESS = {"code":1100,"msg":"获取权限列表成功"}
    PERMISSION_GET_LIST_FAIL = {"code":1101,"msg":"获取权限列表失败"}

    LOGIN_NUMS_ERROR = {"code": 1007, "msg": "账号密码错误次数过多，请5分钟后重试！"}
    USER_UPLOAD_IMAGE_IS_ERROR = {'code': 1006, 'msg': '上传图片不符合标准'}
    USER_UPLOAD_NAME_IS_EXITS = {'code': 1007, 'msg': '用户名已存在'}
    USER_AUTH_ID_CART_ERROR = {'code': 1008, 'msg': '身份证号不符合规则'}
    USER_AUTH_IS_NONE = {"code": 1010, "msg": "用户没有认证"}
    SESSION_ERROR = {"code": 1009, "msg": "用户未登录"}

    #商品参数
    GOODS_GET_CATEGORYS_SUCCESS = {"code": 20001, "msg": "获取商品参数成功"}
    GOODS_GET_CATEGORYS_FAIL = {"code":20002,"msg":"获取商品参数失败"}
    GOODS_ADD_CATEGORYS_SUCCESS = {"code":20003,"msg":"添加商品分类成功"}
    GOODS_ADD_CATEGORYS_FAIL = {"code": 20004, "msg": "添加商品分类失败"}
    GOODS_DELETE_CATEGORYS_SUCCESS = {"code": 20005, "msg": "删除商品分类成功"}
    GOODS_DELETE_CATEGORYS_FAIL = {"code": 20006, "msg": "删除商品分类失败"}
    GOODS_GET_PARENTS_SUCCESS = {"code": 20007, "msg": "获取父级分类成功"}
    GOODS_GET_PARENTS_FAIL = {"code": 20008, "msg": "获取父级分类失败"}
    GOODS_PUT_CATEGORYS_SUCCESS = {"code": 20009, "msg": "恢复商品分类成功"}
    GOODS_PUT_CATEGORYS_FAIL = {"code": 20010, "msg": "恢复商品分类失败"}


    # 房屋模块
    MYHOUSE_USER_IS_NOT_AUTH = {'code': 2000, 'msg': '用户没有实名认证'}
    MY_HOUSES_IS_NULL = {"code": 2001, "msg": "没有发布房源"}
    # 订单模块
    ORDER_START_TIME_GT_END_TIME = {'code': 2001, 'msg': '开始时间大于结束时间'}
    ORDER_NOT_PLAY = {"code": 2001, 'msg': "您还有未完成的订单！"}
    # 数据库
    REDIS_ERROR = {'code': 500, 'msg': 'redis连接错误！'}
    REDIS_TIMEOUT = 60 * 60 * 3
    # token验证
    AUTHORIZATION_IS_NULL = {"code": 701, "msg": "当前请求没有权限，请登录后重试"}
    # 短信模块
    REDIS_SMS_CODE_ERROR = {'code': 600, 'msg': '短信保存异常！'}
    SMS_THIRDERR = {'code': 601, 'msg': '第三方服务系统错误！'}
    SEND_SMS_FAILURE = {'code': 601, 'msg': '短信获取失败！'}
    CHECKED_SMS_CODE_ERROR = {'code': 601, 'msg': '该短信验证码已过期或不存在！'}
    CHECKED_SMS_CODE_FAILURE = {'code': 601, 'msg': '短信验证码不匹配！'}
    SEND_SMS_CODE_TIME = {'code': 602, 'msg': '请勿重复发送短信，于1分钟后重试！'}

    # 管理员模块
    ADMIN_LOGIN = {'code': 200, 'msg': '管理员登录成功'}
    ADMIN_LOGIN_PWD_OR_USER = {'code': 500, 'msg': '密码或账号错误'}
    ADMIN_LOGIN_PERM_NOT = {'code': 501, 'msg': '你没有权限'}
    AREA_SAVE_SUCCESS = {'code': 200, 'msg': '区域保存成功！'}
    AREA_UPDATE_SUCCESS = {'code': 200, 'msg': '区域修改成功！'}
    AREA_DELETE_SUCCESS = {'code': 200, 'msg': '区域删除成功！'}
